package com.lwb.ztx.database.greendao.dao;

import android.database.sqlite.SQLiteDatabase;

import java.util.Map;

import de.greenrobot.dao.AbstractDao;
import de.greenrobot.dao.AbstractDaoSession;
import de.greenrobot.dao.identityscope.IdentityScopeType;
import de.greenrobot.dao.internal.DaoConfig;

import com.lwb.ztx.database.greendao.db.Collect;
import com.lwb.ztx.database.greendao.db.Live;

import com.lwb.ztx.database.greendao.dao.CollectDao;
import com.lwb.ztx.database.greendao.dao.LiveDao;

// THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT.

/**
 * {@inheritDoc}
 * 
 * @see de.greenrobot.dao.AbstractDaoSession
 */
public class DaoSession extends AbstractDaoSession {

    private final DaoConfig collectDaoConfig;
    private final DaoConfig liveDaoConfig;

    private final CollectDao collectDao;
    private final LiveDao liveDao;

    public DaoSession(SQLiteDatabase db, IdentityScopeType type, Map<Class<? extends AbstractDao<?, ?>>, DaoConfig>
            daoConfigMap) {
        super(db);

        collectDaoConfig = daoConfigMap.get(CollectDao.class).clone();
        collectDaoConfig.initIdentityScope(type);

        liveDaoConfig = daoConfigMap.get(LiveDao.class).clone();
        liveDaoConfig.initIdentityScope(type);

        collectDao = new CollectDao(collectDaoConfig, this);
        liveDao = new LiveDao(liveDaoConfig, this);

        registerDao(Collect.class, collectDao);
        registerDao(Live.class, liveDao);
    }
    
    public void clear() {
        collectDaoConfig.getIdentityScope().clear();
        liveDaoConfig.getIdentityScope().clear();
    }

    public CollectDao getCollectDao() {
        return collectDao;
    }

    public LiveDao getLiveDao() {
        return liveDao;
    }

}
